package com.ksana.orm.executor;

import java.lang.reflect.Method;
import java.util.List;

/**
 * @author Fall
 */
public interface Executor {
    /**
     * 查询单条数据
     * @param <T>
     * @param statement
     * @param parameters
     * @return
     */
    <T> T selectOne(Method statement, Object... parameters) throws Exception;

    /**
     * 查询多条数据
     * @param <T>
     * @param statement
     * @param parameters
     * @return
     */
    <T> List<T> selectList(Method statement, Object... parameters) throws Exception;

    /**
     * 插入单条数据
     * @param statement
     * @param parameters
     * @return
     */
    Integer insert(Method statement, Object... parameters) throws Exception;

    /**
     * 跟新单条数据
     * @param statement
     * @param parameters
     * @return
     */
    Integer update(Method statement, Object... parameters) throws Exception;

    /**
     * 删除单条数据
     * @param statement
     * @param parameters
     * @return
     */
    Integer delete(Method statement, Object... parameters) throws Exception;
}
